All Questions
166 questions
0votes
1answer
50views
Disable an element with javascript does not work
I have the following code which should disable an element if the sizes match. However, the line "sizes[i].disabled = true;" does not work. <div class="row"> <div ...
0votes
0answers
13views
How can I dynamically render child content in view for ASP.NET Framework? [duplicate]
Let's say I have a html file that works as a wrapper for dynamic html content, that I want to reuse something like this: <div class="content-wrapper"> <div class="header-...
0votes
3answers
386views
How remove a div generated from a foreach loop after clicking in 'X'
i´m using MVC and I have a page where the info was generated from a foreach loop, tha shows the model´s property. @foreach (var chassi in Model.Chassis) { <div ...
0votes
2answers
645views
ASP.NET Core - change form action to list options in view
I have controller for changing website language, saving cookie and returning url. ` using Microsoft.AspNetCore.Localization; using Microsoft.AspNetCore.Mvc; namespace Website.Controllers; public ...
0votes
1answer
472views
How do I get asp-items to populate a select when adding select element to a div?
Using Javascript to add a select dropdown list when a button is clicked, but the select isn't being populated with the data from the viewmodel. Essentially this code creates what I want, but the asp-...
-1votes
1answer
61views
Error with C# in html working with models
I created a repository and now i want to use a foreach to add multiple items to the page but its giving me a error. My objective is: when there is no items in the page it will show a message but if ...
0votes
1answer
127views
Change from checkbox to radio buttons
I have a simple web app on asp.net core mvc with a view that has checkboxes and I want to change that to use radio buttons instead but there's a for loop there and I can't make it work because of that....
0votes
1answer
219views
How do I add 2 lists of text (ViewBag) in select2 and make them shown separatedly in OptGroup
Let's say I have this in my controller: ViewBag.ListA = list_a; ViewBag.ListB = list_b; This is my view: $("#selectForm").select2({ data: (what to add here?), ...
0votes
0answers
179views
A UTF32 value should not include surrogate codepoint values
I'm having trouble with this kind of errors after I try to add the image for the background A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint ...
0votes
1answer
104views
How do I convert a @Html.ActionLink() to a checkbox list?
I have existing code that links different categories to events and when you click on a category, it displays all the events with those categories. I want to convert it to a checklist where the checked ...
0votes
0answers
538views
Displaying local DOCX, DOC, XLS, XLSX file in iframe in ASP.NET MVC
I am trying to display locally stored DOCX, DOC, XLS, XLSX files in a view but I am having problem with that. It did work for PDF's but it's not working those above mentioned file types. Is there any ...
-1votes
1answer
21views
MVC HTML RadioButtonFor Control Calender as options
In ASP.Net MVC Razor, I need to provide a radio button control with two options. One option is Static, the second option is a Calendar control that picks up the date. How to achieve this.
0votes
1answer
396views
Change value color if negative result
I want to change value color to red on my page if the value is negative.I get my values from my DB so perhaps I need to use jQuery or some if else statement in my cshtml.If you know some answers I ...
-1votes
1answer
260views
Access elements inside a Layout View
I am currently working on a website which uses MVC model. I have a Layout page and 4 pages(home,contactus,aboutus,ourwork) which use this Layout. I am having this situation where I want to use the ...
1vote
1answer
85views
how to create links between pages?
public class Libro { public string Titolo { get; set; } public string Autore { get; set; } public string Editore { get; set; } public int ISBN { get; set; } ...